<template>
  <uploader :options="options" class="uploader-example">
    <uploader-unsupport></uploader-unsupport>
    <uploader-drop>
      <uploader-btn>视频</uploader-btn>
      <uploader-btn :attrs="attrs">图片</uploader-btn>
      <uploader-btn :directory="true">文件夹</uploader-btn>
    </uploader-drop>
    <uploader-list></uploader-list>
  </uploader>
</template>

<script>
  import Vue from 'vue'
  import uploader from 'vue-simple-uploader'
  import App from '../App.vue'

  Vue.use(uploader)

  /* eslint-disable no-new */
  new Vue({
    render(createElement) {
      return createElement(App)
    }
  }).$mount('#app')
    export default {
        name: "uploader.vue",
      data () {
        return {
          options: {
            // 可通过 https://github.com/simple-uploader/Uploader/tree/develop/samples/Node.js 示例启动服务
            target: '//localhost:3000/upload',
            testChunks: false
          },
          attrs: {
            accept: 'image/*'
          }
        }
      }
    }
</script>

<style scoped>
  .uploader-example {
    width: 880px;
    padding: 15px;
    margin: 40px auto 0;
    font-size: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, .4);
  }
  .uploader-example .uploader-btn {
    margin-right: 4px;
  }
  .uploader-example .uploader-list {
    max-height: 440px;
    overflow: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
</style>
